package com.itheima.test10;

/**
 * @Author:gy
 * @Date: 2025/09/06 17:13
 * @Description:
 */
public class EggDesc extends Bing{
    //持有被装饰的对象
    private Bing b;
    //提供一个公共的构造方法  接收被装饰的对象
    public EggDesc(Bing b) {
        this.b = b;
    }

    @Override
    public String desc() {
        return b.desc()+",加个鸡蛋";
    }

    @Override
    public double price() {
        return b.price()+1.0;
    }
}
